/*
 * Copyright (c) 2022, tyustli
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2022-03-08     tyustli      first implementation
 */

#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

struct complex_num
{
    float rel;
    float vir;
};

int main(int argc, char *argv[])
{

    struct complex_num num1;
    struct complex_num num2;
    struct complex_num sum = {0, 0};

    printf("input num1 rel and vir:\r\n");
    scanf("%f", &num1.rel);
    scanf("%f", &num1.vir);

    printf("input num2 rel and vir:\r\n");
    scanf("%f", &num2.rel);
    scanf("%f", &num2.vir);

    sum.rel = num1.rel + num2.rel;
    sum.vir = num1.vir + num2.vir;

    printf("sum is %.1f+%.1fi\r\n", sum.rel, sum.vir);

    return 0;
}
/********************** end of file **************************/
